package cn.tedu.oop;

public class TestPrivateFeild {
    public static void main(String[] args) {
        Cat c=new Cat();
        c.setName("喵喵");
        System.out.println(c.getName());
        c.setAge(5);
        System.out.println(c.getName()+"的年龄是"+c.getAge()+"岁");
    }
}
class Cat{
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}